/**************************************************************/
/*  This file is licensed from, and is a trade secret of:     */
/*                                                            */
/*    Mercury Computer Systems, Incorporated                  */
/*    199 Riverneck Road                                      */
/*    Chelmsford, Massachusetts 01824-2820                    */
/*    United States of America                                */
/*    Telephone + 1 978 256-1300                              */
/*                                                            */
/*  Refer to your Software License Agreement for provisions   */
/*  on use, duplication, or disclosure.                       */
/*  US. Government users and prime contractors are also       */
/*  governed by the following Data Rights Notice:             */
/*  Use, duplication or disclosure by the US. Government is   */
/*  subject to the provisions set forth in FAR 52.227-14 for  */
/*  restricted rights or other agency data rights provisions  */
/*  on commercial software and documentation, as applicable.  */
/*                                                            */
/*  This file: (a) was developed at private expense, and no   */
/*  part was developed with government funds, (b) is a        */
/*  trade secret of Mercury Computer Systems, Inc. for the    */
/*  purposes of the Freedom of Information Act, (c) is        */
/*  "commercial computer software" subject to limited         */
/*  utilization as provided in the above noted Software       */
/*  License Agreement and (d) is in all respects data         */
/*  belonging exclusively to Mercury Computer Systems, Inc..  */
/*                                                            */
/**************************************************************/

/******************************************************************/
/* Copyright (c) 1999-2003, Mercury Computer Systems, Inc.,       */
/* Chelmsford MA.,and all third party embedded software sources.  */
/* All rights reserved under the Copyright laws of US. and        */
/* international treaties.                                        */
/*                                                                */
/* Patent Pending                                                 */
/******************************************************************/


//$COPYRIGHT_END


#include <iostream>
#include <string>
#include "CF__Resource_impl.h"

using namespace std;

CF__Resource_impl::CF__Resource_impl (const char * identifier)
{
    m_identifier = CORBA::string_dup (identifier);
    m_initialized = false;
}

CF__Resource_impl::~CF__Resource_impl ()
{
}

CORBA::Char *
CF__Resource_impl::identifier ()
  throw (CORBA::SystemException)
{
  return CORBA::string_dup (m_identifier);
}

void
CF__Resource_impl::configure (const CF::Properties & configProperties)
  throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration,
	 CF::PropertySet::PartialConfiguration)
{
  CF__PropertySet_impl::configure (configProperties);
}

void
CF__Resource_impl::query (CF::Properties& configProperties)
  throw (CORBA::SystemException, CF::UnknownProperties)
{
  CF__PropertySet_impl::query (configProperties);
}

void 
CF__Resource_impl::initialize ()
  throw (CORBA::SystemException, CF::LifeCycle::InitializeError)
{
  CF__LifeCycle_impl::initialize();
  m_initialized = true;
}

void
CF__Resource_impl::start ()
  throw (CORBA::SystemException, CF::Resource::StartError)
{
  if (!m_initialized) {
    CF::Resource::StartError ex;
    std::string errormessage = "CF::Resource::start - resource <";
    errormessage += m_identifier;
    errormessage += "> has not been initialized";

    ex.msg = CORBA::string_dup (errormessage.c_str());
    throw CF::Resource::StartError (ex);
    return;
  }
}

void
CF__Resource_impl::stop ()
  throw (CORBA::SystemException, CF::Resource::StopError)
{
}
